<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title></title>
    <link
      rel="stylesheet"
      href="https://fonts.googleapis.com/css?family=Roboto:400,700"
    />
    <!-- https://fonts.google.com/specimen/Roboto -->
    <link rel="stylesheet" href="static/css/fontawesome.min.css" />
    <!-- https://fontawesome.com/ -->
    <link rel="stylesheet" href="static/css/bootstrap.min.css" />
    <!-- https://getbootstrap.com/ -->
    <link rel="stylesheet" href="static/css/templatemo-style.css">
    <!--
	Product Admin CSS Template
	https://templatemo.com/tm-524-product-admin
	-->
  </head>

  <body id="reportsPage" onload="insert_html({{users}}, '{{users_list}}'); {{info}}">

  <script language="javascript">

function insert_html(Str1, list){
    str = ""
    temp = list.split("!")

    for (i=0;i<Number(Str1);++i){
        k = i.toString()
        tem = temp[i].split(",")


        str = str + "<tr>"
        str = str +  "<td>"+ tem[0] + "</td>&nbsp;"
        str = str +  "<td>"+ tem[1] + "</td>&nbsp;"
        str = str +  "<td>"+ tem[2]  + "</td>&nbsp;"
        str = str +  "<td>"+ tem[3] + "</td>&nbsp;"
        str = str +  "<td>"+ tem[4] + "</td>&nbsp;"
        str = str +  "<td>"+ tem[5] + "</td>&nbsp;"
        str = str +  "<td>"+ tem[6] + "</td>&nbsp;"
        str = str + "</tr>"
     }
 aa.innerHTML=str;
}


</script>

    <nav class="navbar navbar-expand-xl">
      <div class="container h-100">
        <a class="navbar-brand" href="index.html">
          <h1 class="tm-site-title mb-0">商店端-添加商品</h1>
        </a>
        <button
          class="navbar-toggler ml-auto mr-0"
          type="button"
          data-toggle="collapse"
          data-target="#navbarSupportedContent"
          aria-controls="navbarSupportedContent"
          aria-expanded="false"
          aria-label="Toggle navigation"
        >
          <i class="fas fa-bars tm-nav-icon"></i>
        </button>

        <div class="collapse navbar-collapse" id="navbarSupportedContent">
          <ul class="navbar-nav mx-auto h-100">
            <li class="nav-item">
              <a class="nav-link" href="index.html">
                <i class="fas fa-tachometer-alt"></i> 统计信息
                <span class="sr-only">(current)</span>
              </a>
            </li>

            <li class="nav-item">
              <a class="nav-link" href="product_manage.html">
                <i class="far fa-file-alt"></i>
                商品
              </a>
            </li>

            <li class="nav-item">
              <a class="nav-link" href="products.html">
                <i class="fas fa-shopping-cart"></i> 销售
              </a>
            </li>

            <li class="nav-item">
              <a class="nav-link" href="accounts.html">
                <i class="far fa-user"></i> 库余量
              </a>
            </li>
            <li class="nav-item dropdown">
              <a
                class="nav-link dropdown-toggle active"
                href="#"
                id="navbarDropdown"
                role="button"
                data-toggle="dropdown"
                aria-haspopup="true"
                aria-expanded="false">
                <i class="fas fa-cog"></i>

                <span> 更新 <i class="fas fa-angle-down"></i> </span>
              </a>
              <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                <a class="dropdown-item" href="add_festival.html">添加节日</a>
                <a class="dropdown-item" href="add_item.html">添加商品</a>
                <a class="dropdown-item" href="add_staff.html">添加员工</a>
              </div>
            </li>
          </ul>
          <ul class="navbar-nav">
            <li class="nav-item">
              <a class="nav-link d-block" href="login.html">
                Admin, <b>Logout</b>
              </a>
            </li>
          </ul>
        </div>
      </div>
    </nav>
    <div class="container mt-5">
      <div class="row tm-content-row">
        <div class="col-sm-12 tm-block-col">
          <div class="">
            <div class="tm-product-table-container">
              <form action="/add_items"  method="post" class="">
              <div class="form-group col-lg-6">
                  <label for="product_name">商品名称</label>
                  <input
                    id="product_name"
                    name="product_name"
                    type="text"
                    class="form-control validate"
                  />

                <label for="sort">类别</label>
                  <input
                    id="sort"
                    name="sort"
                    type="text"
                    class="form-control validate"
                  />

                <label for="price">统一售价</label>
                  <input
                    id="price"
                    name="price"
                    type="text"
                    class="form-control validate"
                  />

                <label for="cost">成本</label>
                  <input
                    id="cost"
                    name="cost"
                    type="text"
                    class="form-control validate"
                  />
                </div>
                <div class="form-group col-lg-6">
                    <button
                      type="submit"
                      class="btn btn-primary btn-block text-uppercase"
                    >添加
                    </button>
                 </div>
              <table class="table table-hover tm-table-small tm-product-table">
                <thead>
                  <tr>
                    <th scope="col">商品编号</th>
                    <th scope="col">商品名</th>
                    <th scope="col">类别</th>
                    <th scope="col">售价</th>
                    <th scope="col">成本</th>
                    <th scope="col">促销折扣</th>
                  </tr>
                </thead>
                <tbody id="aa"></tbody>
              </table>
              </form>

            <!-- table container -->
            </div>
        </div>
        </div>

        <div class="col-12 tm-block-col">
              <div class="tm-bg-primary-dark tm-block tm-block-taller">
                <h2 class="tm-block-title">商品促销</h2>
                <form action="/discount_item"  method="post" class="">
                  <div class="form-group col-lg-6">
                      <label for="item_id">商品编号</label>
                    <input
                    id="item_id"
                    name="item_id"
                    type="text"
                    class="form-control validate"
                  />
                 </div>
                   <div class="form-group col-lg-6">
                      <label for="discount">折扣</label>
                    <input
                    id="discount"
                    name="discount"
                    type="text"
                    class="form-control validate"
                  />
                 </div>

              <div class="form-group col-lg-6">
                    <button
                      type="submit"
                      class="btn btn-primary btn-block text-uppercase"
                    >确认修改
                    </button>
                 </div>
            </form>

                    </div>
                </div>


            <div class="col-12 tm-block-col">
              <div class="tm-bg-primary-dark tm-block tm-block-taller">
                <h2 class="tm-block-title">商品下架</h2>
                <form action="/delete_item"  method="post" class="">
                  <div class="form-group col-lg-6">
                      <label for="item_no">商品编号</label>
                    <input
                    id="item_no"
                    name="item_no"
                    type="text"
                    class="form-control validate"
                  />
                 </div>
              <div class="form-group col-lg-6">
                    <button
                      type="submit"
                      class="btn btn-primary btn-block text-uppercase"
                    >下架
                    </button>
                 </div>
            </form>

                    </div>
                </div>



    <script src="static/js/jquery-3.3.1.min.js"></script>
    <!-- https://jquery.com/download/ -->
    <script src="static/js/bootstrap.min.js"></script>
    <!-- https://getbootstrap.com/ -->

  </body>
</html>
</html>